package xhttp

import "net/http"

type HttpApiServer struct {
	*ServerEngine
	mux *HttpServerMux
}

func NewHttpApiServer() *HttpApiServer {
	mux := NewHttpServerMux()
	return &HttpApiServer{ServerEngine: NewServerEngine(mux), mux: mux}
}

func (api *HttpApiServer) RegisterHandler(pattern string, method string, handler http.HandlerFunc) error {
	return api.mux.RegisterHandler(pattern, method, handler)
}

func (api *HttpApiServer) RegisterSessionHandler(pattern string, method string, handler SessionHandlerFunc) error {
	return api.mux.RegisterSessionHandler(pattern, method, handler)
}
